<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<?php $this->load->view('common/head');?>
<body class="no-skin">
<?php $this->load->view('common/header');?>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <?php $this->load->view('common/sidebar');?>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <?php $this->load->view('common/breadcrumbs');?>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">

                <?php $this->load->view('common/set');?>

                <!-- /section:settings.box -->
                <div class="row">
                        <form class="form-inline" action="" method="get" style='text-align:center;'>
                            <?php echo csrf_hidden();?>
                            <div class="space-4"></div>
                            <table class="table table-striped table-bordered" style="width:50%; margin:0px auto; ">
                                <thead>
                                <tr>
                                    <th class="center">技术参与</th>
                                    <th class="center">均价/天</th>
                                    <th class="center">参与人员</th>
                                </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td class="center"><input type="hidden" name="uis" value="<?php echo $this->config->item('web_ui')?>"><span class="btn btn-yellow btn-sm"><?php echo $this->config->item('web_ui')?></span></td>
                                        <td class="center"><input type="hidden" name="uis_num" value="<?php echo $this->config->item('web_ui_num')?>"><span class="btn btn-success btn-sm"><?php echo $this->config->item('web_ui_num')?></span></td>
                                        <td class="center"><input type="number" name="uis_day" id="uis_day" value="<?php if(isset($uis_day)) echo $uis_day;?>">人</td>
                                    </tr>
                                    <tr>
                                        <td class="center"><input type="hidden" name="web" value="<?php echo $this->config->item('web_web')?>"><span class="btn btn-primary btn-sm"><?php echo $this->config->item('web_web')?></span></td>
                                        <td class="center"><input type="hidden" name="web_num" value="<?php echo $this->config->item('web_web_num')?>"><span class="btn btn-success btn-sm"><?php echo $this->config->item('web_web_num')?></span></td>
                                        <td class="center"><input type="number" name="web_day" id="web_day" value="<?php if(isset($web_day)) echo $web_day;?>">人</td>
                                    </tr>
                                    <tr>
                                        <td class="center"><input type="hidden" name="phps" value="<?php echo $this->config->item('web_php')?>"><span class="btn btn-purple btn-sm"><?php echo $this->config->item('web_php')?></span></td>
                                        <td class="center"><input type="hidden" name="phps_num" value="<?php echo $this->config->item('web_php_num')?>"><span class="btn btn-success btn-sm"><?php echo $this->config->item('web_php_num')?></span></td>
                                        <td class="center"><input type="number" name="phps_day" id="phps_day" value="<?php if(isset($phps_day)) echo $phps_day;?>">人</td>
                                    </tr>

                                <tr> <td class="center" colspan="2"><span class="btn btn-light">总共预期</span></td><td><input type="number" id="allday" name="allday" value="<?php if(isset($allday)) echo $allday;?>">天</td></tr>
                                    <?php if(isset($allmoney)){?>
                                        <tr> <td class="center" colspan="2"><span class="btn btn-pink">总共预计花费</span></td><td><span class="btn btn-pink"><?php echo $allmoney?>元</span></td></tr>
                                <?php }?>
                                </tbody>
                            </table>
                            <div class="space-4"></div>
                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info" type="submit">
                                    <i class="icon-ok bigger-110"></i>
                                    计算
                                </button>
                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="reset">
                                    <i class="icon-undo bigger-110"></i>
                                    重置
                                </button>
                            </div>
                        </form>
                    <div class="col-xs-12">

                    </div>

                    <!--                        {$page}-->
                    <!-- PAGE CONTENT ENDS -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.page-content -->
    </div><!-- /.main-content -->

    <?php $this->load->view('common/footer');?>
</div><!-- /.main-container -->

<?php $this->load->view('common/footerjs');?>
<?php echo admin_js_url('laydate');?>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {
        $(".btn-info").click(function () {
            var allday = $("#allday").val();
            var uis_day = $("#uis_day").val();
            var web_day = $("#web_day").val();
            var phps_day = $("#phps_day").val();
            if(uis_day<0 || web_day<0 || phps_day<0){
                bootbox.dialog({
                    title:"系统提示",
                    message: "人员配置必须大于0",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return false;
            }
            if(allday== ''){
                bootbox.dialog({
                    title:"系统提示",
                    message: "请输入总天数",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return false;
            }

            if(uis_day=='' && web_day=='' && phps_day==''){
                bootbox.dialog({
                    title:"系统提示",
                    message: "你还没有选择任何人员配置",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return false;
            }

            $("#form").submit();
        })
    })

</script>
</body>
</html>
